function ActivitySummary(status) {
    if (!status) status = {work: 0, other: 0, sick: 0, vacation: 0, national: 0};
    this.work = status.work;
    this.other = status.other;
    this.sick = status.sick;
    this.vacation = status.vacation;
    this.national = status.national;                                
}

ActivitySummary.prototype = {
    append: function(another) {
        var status = {work: this.work + another.work,
                      other: this.other + another.other,
                      sick: this.sick + another.sick,
                      vacation: this.vacation + another.vacation,
                      national: this.national + another.national};
        return new ActivitySummary(status);
    },

    eachActivity: function(visitor) {
        var map = {work: this.work, other: this.other, sick: this.sick, vacation: this.vacation, national: this.national};
        var index = 0;
        for(var activity in map){
            visitor(activity, this[activity], index++);
        }
    },

    total: function() {
        return this.work + this.other + this.sick + this.vacation + this.national;
    }
}
